package 设计模式.SimpleFactory;

public class TrafficFactory {
    private TrafficFactory(){ }
    public static Traffic make(String type){
        switch (type){
            case "火车":return new Train();
            case "汽车":return new Car();
            case "拖拉机":
                default:return null;
        }
    }
}
